package com.eddie.principle.liskov;

/**
 * @author Eddie
 * @date 2022/4/27 14:37
 */
public class Liskov {

    public static void main(String[] args) {

    }

}

class A {
    public int func1(int num1, int num2) {
        return num1 - num2;
    }
}

/**
 * B继承了A
 */
class B extends A {

    /**
     * //重写了方法导致本意变换
     *
     */
    @Override
    public int func1(int num1, int num2) {
        return num1 + num2;
    }

    public int func2(int num1, int num2) {
        return func1(num1, num2) + 9;
    }
}